import time

from selenium.webdriver.common.by import By
from Base.Base import Base


class Page(Base):
    #账号输入
    name=(By.NAME,'userName')
    #密码输入
    password=(By.NAME,'password')
    #点击登录
    login=(By.ID,'but_login')

    #登录成功断言
    excep=(By.XPATH,'/html/body/div[2]/div/div[2]/ul/li[3]/a/span/span')

    def login1(self):
        self.open_url('http://152.136.104.73:8080/jeewms/')
        self.clear(self.name)
        self.send_keys(self.name,'admin')
        self.clear(self.password)
        self.send_keys(self.password,'llg123')
        time.sleep(10)
        self.click(self.login)
        #断言方法
        return self.execp(self.excep)

